<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
</head>
<body>
<div id="app">

    <table border="1" width="200px" cellpadding="30px">
        <tr>
            <td @click="currentCom='sel1'">选项卡1</td>
            <td @click="currentCom='sel2'">选项卡2</td>
            <td @click="currentCom='sel3'">选项卡3</td>
        </tr>
    </table>

 <component :is="currentCom"></component>
</div>
<template id="tem1">
    <div>
        11111111111111
    </div>
</template>
<template id="tem2">
    <div>
        22222222222222
    </div>
</template>
<template id="tem3">
    <div>
        33333333333333
    </div>
</template>
<script>
    new Vue({
        el: '#app',
        data: {
            currentCom: ''
        },
        components: {
            sel1: {
                template: '#tem1'
            },
            sel2: {
                template: '#tem2'
            },
            sel3: {
                template: '#tem3'
            }
        }
    })
</script>
</body>
</html>
